package com.evil.common.application.dto.process.node;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 应用流程节点 返回实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class NodeRespInfoDTO extends NodeInfoDTO {

    /**
     * 上级节点id
     */
    private Long parentNodeId;

    /**
     * 下一节点
     */
    @Valid
    private NodeRespInfoDTO nextNode;

    /**
     * 结束节点
     */
    @Valid
    @NotNull(message = "结束节点不能为空")
    private NodeRespInfoDTO endNode;

    /**
     * 分支节点
     */
    @Valid
    private List<NodeRespInfoDTO> branches;

    public NodeRespInfoDTO() {
        this.branches = new ArrayList<>();
    }
}
